package fr.jibhaine
{
	import flash.media.Sound;
	import flash.media.SoundChannel;
	
	public class AudioManager
	{
		/** Le son en cours de lecture */
		private var sound: Sound;
		
		private var channel: SoundChannel;
		/** Vrai si le player est en cours de lecture */
		private var isPlaying:Boolean;
		private var songPosition:int=0;
		
		private var songArray: Array;
		
		public function AudioManager()
		{
			channel = new SoundChannel();
			sound = new Sound();
			sound.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);

		_playtime = 0;
		// change the number of bars
		_numBars = 60;
		createSpectrumBars();
		_sound.load(new URLRequest(songArray[_songIndex]));
		isplaying = 0;
		_id3Index = 0;
		_sc = _sound.play(_playtime, 25);
		var voltransform: SoundTransform = _sc.soundTransform;
		// set your volume for the mp3
		voltransform.volume = 0.6;
		}

	}
}